CentOS 6
Sponsored Link

Pound : URL Redirect
2015/01/31
 
This is the Redirect settings from URL matching.
This example based on the environment like follows.
        |
--------+--------------------------------------------------------------------
        |
        +-------------------+--------------------+--------------------+
        |10.0.0.30          |10.0.0.51           |10.0.0.52           |10.0.0.53
 +------+-----+     +-------+------+     +-------+------+     +-------+------+
 |  Frontend  |     |   Backend#1  |     |   Backend#2  |     |   Backend#3  |
 |   Pound    |     |  Web Server  |     |  Web Server  |     |  Web Server  |
 +------------+     +--------------+     +--------------+     +--------------+

 
For example, Configure Pound like that
HTTP connections to dlp.srv.world are forwarded to Backend#1,
HTTP connections to dlp.virtual.host are forwarded to Backend#2,
HTTP connections to others except above are forwarded to Backend#3.
[1] Configure Pound.
[root@dlp ~]#
mv /etc/pound.cfg /etc/pound.cfg.org

[root@dlp ~]#
vi /etc/pound.cfg
User "pound"
Group "pound"
LogLevel 3
LogFacility local1
Alive 30

ListenHTTP
    Address 0.0.0.0
    Port 80
End

Service
    # define for dlp.srv.world

    HeadRequire "Host: .*dlp.srv.world"
    BackEnd
        Address  10.0.0.51
        Port     80
        Priority 5
    End
End

Service
    # define for dlp.virtual.host

    HeadRequire "Host: .*dlp.virtual.host"
    BackEnd
        Address  10.0.0.52
        Port     80
        Priority 5
    End
End

Service
    # define for others

    HeadRequire "Host: .*"
    BackEnd
        Address  10.0.0.53
        Port     80
        Priority 5
    End
End

[root@dlp ~]#
/etc/rc.d/init.d/pound restart

Stopping Pound: [ OK ]
Starting Pound: starting...
[ OK ]
[2] Make sure all works fine to access to the frontend server from a Client with HTTP like follows.
 
Tweet